<?php 
	 $html->css("dashboard", null, array("inline"=>false));
	 $html->script('dashboard', false);
?>
<script type="text/javascript">
	var nav = new NavState("#nav");	
	nav.changeCurrent(0);
</script>
<div id="stream">
	<div class="stream-outer">
		<ul id="tab">
			<li><a href="/dorimeme/dashboard" class="tabCurrent">TimeLine</a></li>
			<li><a href="/dorimeme/users/messages">Message</a></li>
			<li id="showFavor"><a href="/dorimeme/users/favors">Favor</a></li>
			<li style="display:none"><a href="/dorimeme/users/list">Lists</a></li>
			<li><a href="/dorimeme/tags/search">Search</a></li>
			<li><a href="/dorimeme/posts/add">New Post</a></li>
		</ul><!--End tab-->
		<div id="tabSubMenu">	
			<div id="tabSubMenuTop"></div>		
			<div  id="tabSubMenuContent">
				<ul>
					<li class="first"><a href="#">List 1</a></li>
					<li><a href="#">List 2</a></li>
					<li><a href="#">List 3</a></li>
					<li class="last"><a href="#">List 4</a></li>
				</ul>
			</div>
			<div id="tabSubMenuBottom"></div>				
		</div>
		<div id="noti">
			<p><span>20</span> new messages</p>
		</div><!--End noti-->
	</div><!--End stream-outer-->
	<div class="thread-outer">
		<div id="thread">
			<?php
				foreach($posts as $post){
					if($post['Post']['reblog']){
						$reblog = "rebloged";
					}else{
						$reblog = "reblog";
					}
					if($post['Post']['like']){
						$favor = "favored";
					}else{
						$favor = "favor";
					}
			?>			
			<div class="item">
				<div class="pic">
					<a href="#">
						<img src="/dorimeme/app/webroot/img/usericon/<?php echo $post['Post']['username'] ?>.jpg" />						
					</a>
				</div><!--End pic-->
				<div class="item-content">
					<div class="operation">
						<a class="note-btn" href="/dorimeme/responses/get/<?php echo $post['Post']['id'] ?>"><?php echo $post['Post']['response_count'] ?> notes</a>
						<a class="<?php echo $reblog ?>" href="/dorimeme/posts/reblog/<?php echo $post['Post']['id'] ?>">reblog</a>
						<a class="<?php echo $favor ?>" href="/dorimeme/users/favorPost/<?php echo $post['Post']['id'] ?>">favor</a>
					</div><!--End operation-->
					<p class="author">
						<a href="/dorimeme/blogs/index/<?php echo $post['Post']['blogs_id'] ?>"><?php echo $post['Post']['username'] ?>:</a>
					</p><!--End author-->
					<div class="text-content">
						<a class="postTitle" href="/dorimeme/posts/index/<?php echo $post['Post']['id'] ?>"><?php echo $post['Post']['title'] ?></a>
						<?php echo $post['Post']['excerpt'] ?>						
					</div><!--End text-content-->
					<div class="tag">
						<?php
							foreach($post['Post']['tags'] as $tag){
								echo '<a href="#">#'.$tag['name'].'</a>';
							}
						?>
					</div>
					<div class="clear"></div>
					<div class="noteOuter">
						<ol class="note">
						</ol>
						<div class="noteOperationOuter">
							<div class="status" sytle="display:none">Loading...</div>
							<div class="hideLink">
								<a class="hide" href="#">
									Hide notes
								</a>
							</div>
						</div><!-- End noteOperationOuter -->
					</div><!-- End noteOuter -->
				</div><!--End item-content-->
				<div class="clear"></div>
			</div><!--End item-->
			<?php		
				}
			?>
		</div><!--End Thread-->
	</div><!--End Thread-outer -->
</div>
<div id="sideBar">
	<div id="bgBox"></div>
	<div id="sideBarOuter">
		<div id="sideBarContent">
			<div id="profile">
				<a id="proImg" href="users/settings"><img src="/dorimeme/app/webroot/img/usericon/<?php echo $user['username'] ?>.jpg" /></a>
				<a id="proName" href="users/settings"><?php echo $user['username'] ?></a>
			</div><!--End profile-->
			<div class="box first">
				<h2>Info</h2>
				<div class="boxTop"></div>
				<ul class="boxContent">					
					<li class="current first"><a href="/dorimeme/dashboard" class="following">Following <?php echo $user['following_count'] ?> blogs</a></li>
					<li class="last"><a href="/dorimeme/tags/spotlight" class="followAdd">Add and Remove</a></li>
				</ul>
				<div class="boxBottom"></div>
			</div><!--End box-->
			<div class="box" id="trackTags">
				<h2>Tracked Tags</h2>
				<div class="boxTop"></div>
				<ul class="boxContent">
					<?php
						$i = 0;
						$length = count($usertags);
						foreach($usertags as $usertag){
							if($length == 1){
								$li = '<li class="first last">';
							}else if($i == 0){								
								$li = '<li class="first">';
							}else if($i == ($length-1)){
								$li = '<li class="last">';
							}else{
								$li = '<li>';
							}
							$li .= '<a href=/dorimeme/tags/search/'.$usertag['name'].' class="tag">'.$usertag['name'];
							$li .= '</a><a href="#" class="tagRemove">x</a><a href="#" class="tagTrack">Track</a></li>';							
							echo $li;
							$i++;
						}
					?>
				</ul>
				<div class="boxBottom"></div>
			</div><!--End box-->
		</div><!--End sideBarContent-->
	</div><!--End sideBarOuter-->
</div><!--End sideBar-->